/*
* yiji.com Inc.
* Copyright (c) 2017 All Rights Reserved.
* create by muyu
* date:2017-06-14
*/
package com.zerone.pay.trade.repository.entity;

import com.acooly.core.common.domain.AbstractEntity;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 * tbl_trade_info Entity
 *
 * @author muyu
 *         Date: 2017-06-14 18:02:46
 */
@Entity
@Table(name = "trade_info")
public class TradeInfo extends AbstractEntity {
    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 1L;


    /**
     * 与交易表的交易号相同,维持关联关系
     */
    @Column(name = "trade_no", columnDefinition = "varchar(20) not null comment'交易号'")
    private String tradeNo;

    /**
     * 付款银行类型
     */
    @Size(max = 16)
    @Column(name = "bank_type", columnDefinition = "varchar(16) not null comment'交易号'")
    private String bankType;

    /**
     * 通知URL
     */
    @Column(name = "notify_url", columnDefinition = "varchar(256) comment'通知地址'")
    private String notifyUrl;

    /**
     * 预支付ID
     */
    @NotEmpty
    @Column(name = "prepay_id", columnDefinition = "varchar(64) comment'通知地址'")
    private String prepayId;

    /**
     * 二维码链接
     */
    @NotEmpty
    @Column(name = "code_url", columnDefinition = "varchar(256) comment'通知地址'")
    private String codeUrl;

    /**
     * 超时关闭时间
     */
    @Column(name = "expire", columnDefinition = "bigint comment'通知地址'")
    private long expire;

    /**
     * 用户自定义元数据
     */
    @NotEmpty
    @Column(name = "metadata", columnDefinition = "varchar(256) comment'通知地址'")
    private String metadata;

    /**
     * 特定渠道额外附加参数
     */
    @NotEmpty
    @Column(name = "extra", columnDefinition = "varchar(256) comment'特定渠道额外附加参数'")
    private String extra;

    /**
     * 客户端IP
     */
    @Size(max = 20)
    @Column(name = "client_ip", columnDefinition = "varchar(20) comment'客户端IP'")
    private String clientIp;

    /**
     * 错误码
     */
    @Size(max = 32)
    @Column(name = "err_code", columnDefinition = "varchar(32) comment'错误码'")
    private String errCode;

    /**
     * 错误描述
     */
    @NotEmpty
    @Column(name = "err_code_msg", columnDefinition = "varchar(128) comment'错误描述'")
    private String errCodeMsg;

    /**
     * 支付宝的用户登录名，微信没有
     */
    @Size(max = 128)
    @Column(name = "buyer_logon_id", columnDefinition = "varchar(128) comment'错误描述'")
    private String buyerLogonId;

}
